<include file="public:header" />
    <notempty name="apply['Subsite']">
    <div class="seltpye_x">
        <div class="left">所属分站</div>
        <qscms:subsite 列表名="subsite_list"/>
        <div class="right">
          <a href="{:P(array('subsite_id'=>''))}" <if condition="$Think.get.subsite_id eq ''">class="select"</if>>不限</a>
          <if condition="$visitor['role_id'] eq 1">
            <volist name="subsite_list" id="subsite">
              <a href="{:P(array('subsite_id'=>$subsite['s_id']))}" <if condition="$Think.get.subsite_id eq $subsite['s_id']">class="select"</if>>{$subsite.s_sitename}</a>
            </volist>
          <else/>
            <volist name="subsite_list" id="subsite">
              <if condition="in_array($subsite['s_id'],$visitor['subsite'])">
                <a href="{:P(array('subsite_id'=>$subsite['s_id']))}" <if condition="$Think.get.subsite_id eq $subsite['s_id']">class="select"</if>>{$subsite.s_sitename}</a>
              </if>
            </volist>
          </if>
          <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
    </notempty>
    <div class="seltpye_x">
        <div class="left">处理状态</div>    
        <div class="right">
        <a href="{:P(array('status'=>''))}" <if condition="$Think.get.status eq ''">class="select"</if>>不限</a>
        <a href="{:P(array('status'=>'0'))}" <if condition="$Think.get.status eq '0'">class="select"</if>>未处理<if condition="$count"><span>({$count})</span></if></a>
        <a href="{:P(array('status'=>1))}" <if condition="$Think.get.status eq 1">class="select"</if>>已处理</a>
        <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
    <div class="seltpye_x">
        <div class="left">添加时间</div>    
        <div class="right">
        <a href="{:P(array('settr'=>''))}" <if condition="$Think.get.settr eq ''">class="select"</if>>不限</a>
        <a href="{:P(array('settr'=>3))}" <if condition="$Think.get.settr eq 3">class="select"</if>>三天内</a>
        <a href="{:P(array('settr'=>7))}" <if condition="$Think.get.settr eq 7">class="select"</if>>一周内</a>
        <a href="{:P(array('settr'=>30))}" <if condition="$Think.get.settr eq 30">class="select"</if>>一月内</a>
        <a href="{:P(array('settr'=>180))}" <if condition="$Think.get.settr eq 180">class="select"</if>>半年内</a>
        <a href="{:P(array('settr'=>360))}" <if condition="$Think.get.settr eq 360">class="select"</if>>一年内</a>
        <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
    <form id="form1" name="form1" method="post" action="{:U('delete')}">
        <table width="100%" border="0" cellpadding="0" cellspacing="0"  id="list" class="link_lan">
            <tr>
            <td width="150"   class="admin_list_tit admin_list_first" >
            <label id="chkAll"><input type="checkbox" name="" title="全选/反选" id="chk"/>真实姓名</label></td>
            <td width="30%"  class="admin_list_tit"  >申诉描述</td>
            <td align="center" class="admin_list_tit">联系手机</td>
            <td align="center" class="admin_list_tit">联系邮箱</td>
            <td align="center" class="admin_list_tit">处理状态</td>
            <td width="100" align="center" class="admin_list_tit">添加时间</td>
            <td width="200" align="center" class="admin_list_tit">操作</td>
            </tr>
            <volist name="list" id="vo">
                <tr>
                <td   class="admin_list admin_list_first" >
                <input name="id[]" type="checkbox" id="id" value="{$vo.id}"/>
                    {$vo['realname']}
                </td>
                <td  class="admin_list vtip" title="{$vo.description|nl2br}" >{$vo.description}</td>
                <td align="center" class="admin_list">{$vo.mobile}</td>
                <td align="center" class="admin_list">{$vo.email}</td>
                <td align="center" class="admin_list">
                    <switch name="vo['status']">
                        <case value="0"><font color="red">未处理</font></case>
                        <case value="1"><font color="green">已处理</font></case>
                    </switch> 
                </td>
                <td align="center" class="admin_list">{:admin_date($vo['addtime'])}</td>
                <td align="center" class="admin_list">
                <if condition="$vo['status'] eq 1">
                    <a href="{:U('set_status',array('id'=>$vo['id'],'status'=>0))}" onclick="return confirm('确定设为未处理吗？')">设为未处理</a>&nbsp;&nbsp;&nbsp;
                <else />
                    <a href="{:U('set_status',array('id'=>$vo['id'],'status'=>1))}" onclick="return confirm('确定设为已处理吗？')">设为已处理</a>&nbsp;&nbsp;&nbsp;
                    <a href="javascript:;" class="send_mail" data="{$vo['email']}" data_id="{$vo['id']}">发送邮件</a>&nbsp;&nbsp;&nbsp;
                </if>
                <a href="{:U('delete',array('id'=>$vo['id']))}" onclick="return confirm('确定删除吗？')">删除</a>
                </td>
                </tr>
            </volist>
        </table>
        <empty name="list">
            <div class="admin_list_no_info">没有任何信息！</div>
        </empty>
        <table width="100%" border="0" cellspacing="10" cellpadding="0" class="admin_list_btm">
            <tr>
                <td>
                <input type="button" class="admin_submit" id="ButSet" value="设置状态"/>
                <input type="button" class="admin_submit" id="ButDel" value="删除所选"/>
                </td>
                <td width="305" align="right"></td>
            </tr>
        </table>
    <span id="OpSet"></span>
    <span id="OpSend"></span>
    </form>
    <div class="qspage">{$page}</div>
</div>
<div style="display:none" id="OpSetLayer">
  <table width="400" border="0" align="center" cellpadding="0" cellspacing="6" >
    <tr>
      <td width="20" height="30">&nbsp;</td>
      <td height="30"><strong  style="color:#0066CC; font-size:14px;">将所选记录设置为：</strong></td>
    </tr>
    
    <tr>
      <td height="25">&nbsp;</td>
      <td>
        <label >
          <input name="status" type="radio" value="1" checked="checked"/>
        已处理 </label>   </td>
      </tr>
      <tr>
        <td height="25">&nbsp;</td>
        <td><label >
          <input type="radio" name="status" value="0" />
        未处理</label></td>
      </tr>
      <tr>
        <td height="25">&nbsp;</td>
        <td><input type="button" name="set_status" id="set_status" value="确定" class="admin_submit"    /></td>
      </tr>
    </table>
  </div>
  <div style="display:none" id="OpSendLayer">
  <table width="400" border="0" align="center" cellpadding="0" cellspacing="6" >
    <tr>
      <td width="80" height="25">登录用户名：</td>
      <td><input name="login_username" type="text" class="input_text_200"/> </td>
      </tr>
      <tr>
        <td height="25">登录密码：</td>
        <td><input name="login_password" type="text" class="input_text_200"/></td>
      </tr>
      <tr>
        <td height="25">邮件模板：</td>
        <td>您好！您的申诉已被受理，您的登录账号是：sadsadsad，您的登录密码是：sadsadsadsad</td>
      </tr>
      <tr>
        <td height="25">&nbsp;</td>
        <td>
        <input type="hidden" name="email" id="email_val" value=""/>
        <input type="hidden" name="id" id="id_val" value=""/>
        <input type="button" name="send_email" id="send_email" value="确定" class="admin_submit"    />
        </td>
      </tr>
    </table>
  </div>
<include file="public:footer" />
<script type="text/javascript">
    $(document).ready(function(){
        $("#ButSet").QSdialog({
          DialogAddObj:"#OpSet",
          DialogTitle:"请选择",
          DialogContent:"#OpSetLayer",
          DialogContentType:"id"
          });
        $("#ButDel").click(function(){
            if(confirm('确定删除所选记录吗？')){
                $("#form1").submit();
            }
        });
        $("#set_status").live('click',function(){
            $("#form1").attr('action',"{:U('set_status')}");
            $("#form1").submit();
        });
        $(".send_mail").QSdialog({
          DialogAddObj:"#OpSend",
          DialogTitle:"发送邮件",
          DialogContent:"#OpSendLayer",
          DialogContentType:"id"
          });
        $(".send_mail").live('click',function(){
            $("#email_val").val($(this).attr("data"));
            $("#id_val").val($(this).attr("data_id"));
        });
        $("#send_email").live('click',function(){
            $("#form1").attr('action',"{:U('send_email')}");
            $("#form1").submit();
        });
    });
</script>
</body>
</html>